<form id="merchantFindusersaddfm<?php echo $uniqid;?>" method="post" style="padding: 8px;">
	<table border="0" width="100%" cellspacing="1" cellpadding="5" class="formtable">
		<tr bgcolor="#FFFFFF">
			<td  class="tlabel"   width="20%">用户名：</td>
			<td width="80%">
				<input type="hidden" v-model="params.member_id">
				<el-tag v-if="params.member_id"
						:key="member_name"
						:closable="false"
						size="medium">
					{{member_name}}
				</el-tag>
				<el-button class="button-new-tag" size="mini" @click="addMember">+ 选择店员</el-button>
			</td>
		<tr bgcolor="#FFFFFF">
			<td  class="tlabel" width="20%">角色：</td>
			<td width="80%">
			<SELECT v-model='params.roles_id' style="width:153px; height:25px;border: 1px solid #065dc7" size='1' class="forminput inputstyle">
				<OPTION :value="item.id" v-for="item of roles">{{item.name}}</OPTION>
			</SELECT>
			</td>
		</tr>
</table>
</form>
<div id="merchantUserAdddlg" class="easyui-dialog" style="width:700px; height:580px;" title="信息框" closed="true"></div>
<script>
	var merchantUserAddVm = new Vue({
		el: '#merchantFindusersaddfm<?php echo $uniqid;?>',
		data: {
			params:{
				member_id:0,
				roles_id:0,
			},
			member_name:'',
			roles: JSON.parse("<?php echo addslashes($roles);?>"),
		},
		mounted() {},
		methods: {
			init() {},
			addMember(){
				$("#merchantUserAdddlg").dialog({
					title: '选择店员',
					closed: false,
					width: 800,
					height:638,
					cache: false,
					href: '/merchant/system/finduser',
					modal: true,
					buttons: [{
						text: '确定',
						id: 'merchantFindmembersubmit',
						iconCls: 'icon-ok',
					}, {
						text: '取消',
						iconCls: 'icon-no',
						handler: function () {
							$("#merchantUserAdddlg").dialog('close');
						}
					}]
				});
			},
		}
	});
$(function(){
		$('#dianpuUsersaddsubmit').click(function(data){
			$.post('/merchant/system/usersadd', merchantUserAddVm.params, function(data){
				if(data.ret===0){
					$.messager.show({
						title:'提示',
						msg:data.msg,
						timeout:3000,
						showType:'slide'
					});
					$('#merchantFindusersaddfm<?php echo $uniqid;?>').form('clear');
					$("#dianpuUsersdlg").dialog('close');
					dianpuUsersReload();
				}else{
					$.messager.alert('提示',data.msg,'warning');
				}
			});
		})
});
</script>
<style>
	.button-new-tag{
		background-color: #b5dec0;
		color: #cc3333;
		vertical-align: middle;
	}

	#merchantFindusersaddfm<?php echo $uniqid;?> .el-tag{
		vertical-align: middle;
	}
</style>